﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Web.Mvc;
using System.Web.Http.Owin;
using System.IdentityModel.Services;
using Auth0;
using WorkBasket.Infrastructure;
using System.Configuration;

namespace WorkBasket.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            if (ConfigurationManager.AppSettings["UnderConstruction"]=="true")
            {
                Response.Redirect("~/errors/Construction");

            }

 
            return View();
        }
 


        [MyAuth]
        public ActionResult Logoff()
        {

            FederatedAuthentication.SessionAuthenticationModule.SignOut();
            Response.Redirect("~/home");
            return View();
        }
        [MyAuth]
        public ActionResult Profile()
        {


 
            UserProfile up = AuthFunctions.CurrentUser();
            ViewBag.Name = up.Name;
            ViewBag.Picture = up.Picture;

             return View();
        }
  
 
    }
}
